

import pymysql
import pymysql.cursors

if __name__ == '__main__':
    with pymysql.connect(host="localhost",port=3308,db="java86school",user="root",password="root1234") as con:
        cursor=con.cursor()
        r=cursor.execute("select * from s_student order by stuno desc limit 1")
        print(f"找到了{r}行")
        ar=cursor.fetchall()
        for x in ar:
            print(x[0],x[1],x[2])
